package com.dyzx.hbb.modules.fcxs.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dyzx.hbb.common.config.MyLambdaQueryWrapper;
import com.dyzx.hbb.modules.fcxs.entity.FcxsHouse;
import com.dyzx.hbb.modules.fcxs.service.FcxsHouseService;
import com.dyzx.hbb.modules.fcxs.mapper.FcxsHouseMapper;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 房屋服务实现类
 * 
 * 功能说明：实现房源表的业务逻辑操作，包括房屋信息的查询、添加、修改、删除等功能
 * 主要职责：
 * - 实现房屋信息的CRUD操作
 * - 根据ID查询房屋详细信息
 * - 构建房屋信息查询条件
 * 
 * @author 开发团队
 * @version 1.0.0
 * @since 2025-05-20
 */
@Service
public class FcxsHouseServiceImpl extends ServiceImpl<FcxsHouseMapper, FcxsHouse>
    implements FcxsHouseService{

    @Override
    public Map<String, Object> findById(Long houseId) {
        return this.getMap(queryInfoWrapper().eq(FcxsHouse::getId, houseId));
    }
    protected MyLambdaQueryWrapper<FcxsHouse> queryInfoWrapper() {
        MyLambdaQueryWrapper<FcxsHouse> queryWrapper = new MyLambdaQueryWrapper<>();
        queryWrapper.select(FcxsHouse::getId)
                .select(FcxsHouse::getType)
                .select(FcxsHouse::getBuildingNum)
                .select(FcxsHouse::getUnit)
                .select(FcxsHouse::getFloor)
                .select(FcxsHouse::getRoomNum)
                .select(FcxsHouse::getHouseNo)
                .select(FcxsHouse::getInnerArea)
                .select(FcxsHouse::getPublicArea)
                .select(FcxsHouse::getArea);
               /* .select(FcxsHouse::getPrice)
                .select(FcxsHouse::getTotalPrice)
                .select(FcxsHouse::getStatus)
                .select(FcxsHouse::getCreateDate)*/
             //   .select(FcxsHouse::getUpdateDate)
               // .select(FcxsHouse::getUnit)
             //   .organName(FcxsHouse::getOrganId).as("organ_name")
               // .userName(FcxsHouse::getOperatorId).as("operator_name");
        return queryWrapper;
    }
}




